package main

import (
	"html/template"
	"net/http"
)

func testTemplate(w http.ResponseWriter, r *http.Request) {
	// 解析模板
	t, _ := template.ParseFiles("test_demo/demo5_http/response_index.html")
	// t := template.Must(template.ParseFiles("response_index.html"))

	// 执行
	t.Execute(w, "111111111111111111111")
}

func main() {
	http.HandleFunc("/testTemplate", testTemplate)
	// 路由
	http.ListenAndServe(":8080", nil)
}
